package cn.sccl.dirms.monitor.model;

import cn.sccl.common.exception.BusinessException;
import cn.sccl.common.model.BaseModel;

/**
* 模板图标关联表
* 数据库表 t_dist_template_icons 的实体对象
* Created by liupan on 2017-03-13.
*/
public class TemplateAndIcons extends BaseModel{
/**
*表名
*/
public final static String TABLE_NAME ="t_dist_template_icons";

    private java.lang.String templateId;//模板id
    private java.lang.String iconsId;//图标id

    public void setTemplateId(java.lang.String templateId){
    this.templateId = templateId;
    }

        public java.lang.String getTemplateId(){
    return this.templateId;
    }
    public void setIconsId(java.lang.String iconsId){
    this.iconsId = iconsId;
    }

        public java.lang.String getIconsId(){
    return this.iconsId;
    }

/**
* clone一个对象。
* @param cls 需要克隆的对象类型，只能是当前类的子类
* @param
<T>
    * @return
    * @throws IllegalAccessException
    * @throws InstantiationException
    */
    public
    <T extends TemplateAndIcons> T clone(Class
        <T> cls) {
            try {
            T t = cls.newInstance();
            t.setId(this.
            getId());
            t.setCreateTime(this.
            getCreateTime());
            t.setUpdateTime(this.
            getUpdateTime());
            t.setDeleteFlag(this.
            isDeleteFlag());
            t.setTemplateId(this.
            getTemplateId());
            t.setIconsId(this.
            getIconsId());
            return t;
            } catch (Exception e) {
            e.printStackTrace();
            throw new BusinessException("对象克隆失败，请克隆的目标对象是否具有无参的构造函数。", e.getCause());
            }
            }
            }